<%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8"%>
<%@ page import="BP.Web.WebUser"%>
<%@ page import="cn.jflow.model.wf.admin.ccbpm.WelcomeModel"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort()	+ path + "/";
	WelcomeModel w=new WelcomeModel(request, response);
	w.init();
%>
<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
<title>主页</title>
<script src="../../../Scripts/jquery-1.7.2.min.js" type="text/javascript"></script>
<script src="../../../Scripts/jquery/jquery.easyui.min.js" type="text/javascript"></script>
<script src="../../../Scripts/jquery/locale/easyui-lang-zh_CN.js" type="text/javascript"></script>
<script src="../../../Comm/Charts/js/FusionCharts.js" type="text/javascript"></script>
<script src="../../../Scripts/CommonUnite.js" type="text/javascript"></script>
<link href='<%=basePath%>WF/Comm/Style/Table0.css' rel='stylesheet' type='text/css' />
<link href='<%=basePath%>WF/Comm/Style/Tabs.css' rel='stylesheet' type='text/css' />
<style type="text/css">
body {
	margin: 0px;
	padding: 0px;
}

.flow_info {
	padding-left: 15px;
}

.flow_font {
	color: Blue;
}

.flow_font_big {
	font-size: 14px;
	margin-left: 4px;
}

.font_red {
	color: Red;
}

.chart_div {
	width: 800px;
	height: 330px;
	margin: 0px auto;
}

.chart_div_con {
	width: 800px;
	height: 300px;
	float: left;
}

.chart_div_footer {
	width: 100%;
	height: 30px;
	text-align: center;
	line-height: 30px;
}

input {
	vertical-align: text-top;
	margin-top: 0;
}
</style>
<script type="text/javascript">
        function loadFlowUSLChartType() {
            var str1 = $('input:radio[name=anaTime]:checked').val();
            var str2 = $('input:radio[name=flowSort]:checked').val();

            window.location.href = "Welcome.jsp?anaTime=" + str1 + "&flowSort=" + str2 + "&";
        }
        $(function () {
            $("#" + Application.common.getArgsFromHref("anaTime")).attr("checked", true);
            $("#" + Application.common.getArgsFromHref("flowSort")).attr("checked", true);
        });
    </script>
</head>
<body>
	<form id="form1">
		<table style="width: 100%; min-width: 750px;">
			<caption>
				欢迎:
				<%=BP.Web.WebUser.getName() %>
			</caption>
			<tr>
				<td valign="top">
					<fieldset>
						<legend>流程引擎信息</legend>
						<table style="width: 80%;">
							<tr>
								<td class="flow_info"><font class="flow_font">1、</font>流程设计总数
								</td>
								<td><%=w.getTotalFlow()%></td>
								<td>个</td>
							</tr>
							<tr>
								<td class="flow_info"><font class="flow_font">2、</font>节点总数
								</td>
								<td><%=w.getNodeNum()%></td>
								<td>个</td>
							</tr>
							<tr>
								<td class="flow_info"><font class="flow_font">3、</font>平均流程节点数
								</td>
								<td><%=w.getAvgNum()%></td>
								<td>个</td>
							</tr>
							<tr>
								<td class="flow_info"><font class="flow_font">4、</font>启用的流程数
								</td>
								<td><%=w.getRunFlowNum()%></td>
								<td>个</td>
							</tr>
							<tr>
								<td class="flow_info"><font class="flow_font">5、</font>流程启用比率
								</td>
								<td><%= w.getFlowRate()%><font
									class="flow_font flow_font_big">%</font></td>
								<td></td>
							</tr>
							<tr>
								<td class="flow_info"><font class="flow_font">6、</font>平均每流程启动数
								</td>
								<td><%= w.getFlowRateNum()%></td>
								<td>个</td>
							</tr>
						</table>
					</fieldset>
				</td>
				<td valign="top">
					<fieldset>
						<legend>流程实例分析 </legend>
						<table style="width: 80%;">
							<tr>
								<td class="flow_info"><font class="flow_font">1、</font>流程总数
								</td>
								<td><%=BP.DA.DBAccess.RunSQLReturnValInt("SELECT COUNT(WorkID) FROM WF_GenerWorkFlow ")%>
								</td>
								<td>个</td>
							</tr>
							<tr>
								<td class="flow_info"><font class="flow_font">2、</font>正在运行数
								</td>
								<td><%=BP.DA.DBAccess.RunSQLReturnValInt("SELECT COUNT(WorkID) FROM WF_GenerWorkFlow WHERE WFState!=" +  BP.WF.WFState.Complete.getValue())+"  "%>
								</td>
								<td>个</td>
							</tr>
							<tr>
								<td class="flow_info"><font class="flow_font">3、</font>完成数
								</td>
								<td><%=BP.DA.DBAccess.RunSQLReturnValInt("SELECT COUNT(WorkID) FROM WF_GenerWorkFlow WHERE WFState=" + BP.WF.WFState.Complete.getValue()) + " "%>
								</td>
								<td>个</td>
							</tr>
							<tr>
								<td class="flow_info"><font class="flow_font ">4、</font>退回中数
								</td>
								<td class="font_red"><%=BP.DA.DBAccess.RunSQLReturnValInt("SELECT COUNT(WorkID) FROM WF_GenerWorkFlow WHERE WFState=" + BP.WF.WFState.ReturnSta.getValue()) + " "%>
								</td>
								<td>个</td>
							</tr>
							<tr>
								<td class="flow_info"><font class="flow_font">5、</font>删除数
								</td>
								<td class="font_red"><%=BP.DA.DBAccess.RunSQLReturnValInt("SELECT COUNT(WorkID) FROM WF_GenerWorkFlow WHERE WFState=" + BP.WF.WFState.Delete.getValue()) + " "%>
								</td>
								<td>个</td>
							</tr>
							<tr>
								<td class="flow_info"><font class="flow_font">6、</font>其他运行数
								</td>
								<td><%=BP.DA.DBAccess.RunSQLReturnValInt("SELECT COUNT(WorkID) FROM WF_GenerWorkFlow WHERE WFSta=" + BP.WF.WFSta.Etc.getValue()) + "  "%>
								</td>
								<td>个</td>
							</tr>
						</table>
					</fieldset>
				</td>
				<td valign="top">
					<fieldset>
						<legend>考核信息</legend>
						<table>
							<tr>
								<td class="flow_info"><font class="flow_font">1、</font>提前完成分钟数
								</td>
								<td><%=w.getBeforeOver()%></td>
								<td>分钟</td>
							</tr>
							<tr>
								<td class="flow_info"><font class="flow_font ">2、</font>逾期分钟数
								</td>
								<td class="font_red"><%=w.getAfterOver()%></td>
								<td>分钟</td>
							</tr>
							<tr>
								<td class="flow_info"><font class="flow_font">3、</font>按时完成
								</td>
								<td><%=w.getInTimeOverCount()%></td>
								<td>个</td>
							</tr>
							<tr>
								<td class="flow_info"><font class="flow_font">4、</font>超时完成
								</td>
								<td class="font_red"><%=w.getAfterOverCount()%></td>
								<td>个</td>
							</tr>
							<tr>
								<td class="flow_info"><font class="flow_font">5、</font>按时办结率
								</td>
								<td><%=w.getAsRate() %><font
									class="flow_font flow_font_big">%</font></td>
								<td></td>
							</tr>
							<tr>
								<td class="flow_info"><font class="flow_font">6、</font>在运行的逾期
								</td>
								<td><font class="font_red"> <%=w.getRunningFlowOverTime()%></font>
								</td>
								<td>个</td>
							</tr>
						</table>
					</fieldset>
				</td>
			</tr>
			<tr>
				<td colspan="3">
					<div style="width: 100%;">
						<style type="text/css">
body {
	margin: 0px;
	padding: 0px;
}

.flow_info {
	padding-left: 15px;
}

.flow_font {
	color: Blue;
}

.flow_font_big {
	font-size: 14px;
	margin-left: 4px;
}

.font_red {
	color: Red;
}

.chart_div {
	width: 800px;
	height: 330px;
	margin: 0px auto;
}

.chart_div_con {
	width: 800px;
	height: 300px;
	float: left;
}

.chart_div_footer {
	width: 100%;
	height: 30px;
	text-align: center;
	line-height: 30px;
}

input {
	vertical-align: text-top;
	margin-top: 0;
}
</style>
						<script type="text/javascript">
    function loadFlowUSLChartType() {
        var str1 = $('input:radio[name=anaTime]:checked').val();
        var str2 = $('input:radio[name=flowSort]:checked').val();

        window.location.href = "Welcome.jsp?anaTime=" + str1 + "&flowSort=" + str2 + "&";
    }
    $(function () {
        $("#" + Application.common.getArgsFromHref("anaTime")).attr("checked", true);
        $("#" + Application.common.getArgsFromHref("flowSort")).attr("checked", true);
    });
</script>
						<table style="margin: 0 auto; width: 100%;">
							<tr>
								<td valign="top" colspan="3"
									style="padding-left: 10px; padding-right: 40px; border-bottom: 1px solid white;">
									流程图表分析: <input style="margin-left: 32px;" type="radio"
									id="slMouth" name="anaTime" onclick="loadFlowUSLChartType();"
									value="slMouth" checked="checked" /><label for="slMouth">按月（最近12月）</label>
									<input type="radio" id="slWeek" name="anaTime"
									onclick="loadFlowUSLChartType();" value="slWeek" /><label
									for="slWeek">按周（最近15周）</label> <input type="radio" id="slDay"
									name="anaTime" onclick="loadFlowUSLChartType();" value="slDay" /><label
									for="slDay">按日（最近10天）</label>&nbsp;&nbsp;&nbsp;分析维度： <input
									type="radio" id="slFlow" name="flowSort"
									onclick="loadFlowUSLChartType();" value="slFlow"
									checked="checked" /><label for="slFlow">流程实例分析</label> <input
									type="radio" id="cqUnDoFlow" name="flowSort"
									onclick="loadFlowUSLChartType();" value="cqUnDoFlow" /><label
									for="cqUnDoFlow">超期完成流程分布</label>

								</td>
							</tr>
							<tr>
								<td valign="top" colspan="3" style="height: 300px;">
									<div class="chart_div">

										<div class="chart_div_con" id="slChart">
											<!-- START Script Block for Chart Line_3D -->
											<div id='Line_3DDiv'>Chart.</div>
											<script type="text/javascript">
var chart_Line_3D = new FusionCharts({"dataFormat" : "xml", "renderAt" : "Line_3DDiv", "debugMode" : "0", "swfUrl" : "../../../Comm/Charts/Line.swf", "id" : "Line_3D", "wMode" : "opaque", "width" : "800", "height" : "300", "registerWithJS" : "1","dataSource" : "<chart exportEnabled='1' exportAtClient='0' exportAction='download'  exportHandler='/WF/Comm/Charts/FCExport.jsp'  exportDialogMessage='正在生成,请稍候...'   exportFormats='PNG=生成PNG图片|JPG=生成JPG图片|PDF=生成PDF文件' caption='2015-07至2016-06流程实例分析' lineThickness='1' showValues='1' formatNumberScale='0' anchorRadius='2'   divLineAlpha='20' divLineColor='CC3300' divLineIsDashed='1' showAlternateHGridColor='1'  alternateHGridColor='CC3300' shadowAlpha='40' labelStep='2' numvdivlines='5' chartRightMargin='35' bgColor='FFFFFF,CC3300' bgAngle='270' bgAlpha='10,10'  alternateHGridAlpha='5'  legendPosition ='RIGHT '><set label='2015-07' value='0' /><set label='2015-08' value='0' /><set label='2015-09' value='0' /><set label='2015-10' value='0' /><set label='2015-11' value='0' /><set label='2015-12' value='0' /><set label='2016-01' value='0' /><set label='2016-02' value='0' /><set label='2016-03' value='0' /><set label='2016-04' value='0' /><set label='2016-05' value='0' /><set label='2016-06' value='7' /><styles><definition><style name='CaptionFont' type='font' size='12'/></definition><application><apply toObject='CAPTION' styles='CaptionFont' /><apply toObject='SUBCAPTION' styles='CaptionFont' /></application></styles></chart>"}).render();</script>
											<!-- END Script Block for Chart Line_3D -->

										</div>

									</div>
								</td>
							</tr>
						</table>
					</div>
				</td>
			</tr>
		</table>
		<div></div>
	</form>

</body>
</html>